function animate(obj, target, callback) {
    clearInterval(obj.timer2)
  obj.timer2 =setInterval(() => {
    if (obj.offsetLeft == target) {
        clearInterval(obj.timer2)
        if (callback) {
            callback();
        }
        return false
      }
  
      var step = (target - obj.offsetLeft) / 5
       step=step>0?Math.ceil(step):Math.floor(step)
      obj.style.left = obj.offsetLeft+step + 'px'
     
  }, 30);
}
function animate2(obj, target, callback) {
  clearInterval(obj.timer2)
obj.timer2 =setInterval(() => {
  if (obj.offsetLeft == target) {
      clearInterval(obj.timer2)
      if (callback) {
          callback();
      }
      return false
    }

    var step = (target - obj.offsetLeft) / 15
     step=step>0?Math.ceil(step):Math.floor(step)
    obj.style.left = obj.offsetLeft+step + 'px'
   
}, 30);
}